package com.miku.blog.controller;

import com.miku.blog.annotation.SystemLog;
import com.miku.blog.domain.pojo.ResponseResult;
import com.miku.blog.domain.vo.UserVo;
import com.miku.blog.service.UserInfoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author shkstart
 * @create ${}YEAR-06-17 5:49
 */
@Api(tags = "后台管理系统[更新用户信息]")
@RequestMapping("/admin")
@RestController
public class UserInfoAdminController {

    @Autowired
    private UserInfoService userInfoService;


    @SystemLog(notes = "修改用户角色列表及昵称{后台管理系统}")
    @ApiOperation(value = "修改用户角色列表及昵称接口")
    @PutMapping("/users/role")
    public ResponseResult updateNickNameAndRole(@RequestBody UserVo userVo){
        return userInfoService.updateNickNameAndRole(userVo);
    }

}
